const card = {
    state: {
        optionsZi: {},
        searchOptionTable: {},
        cacahMeterAddr: '',
        bluetoothId: '',
        oSearchData: {},
        cardMac: '000000000000',
        flag: 0,
        type: 0,
        bluetoothIdCount: 0,
        waterno: 0,
        waterNo: '',
        cardInfo: {},
        mCount: 0
    },
    actions: {
        dricOptions({ commit }, value) {
            commit('SET_OPTIONS', value)
        }
    },
    mutations: {
        SET_MCOUNT: (state, value) => {
            state.mCount = value;
        },
        SET_OPTIONS: (state, { optionsZi, searchOptionTable }) => {
            state.optionsZi = optionsZi;
            state.searchOptionTable = searchOptionTable;
        },
        SET_METERADDR: (state, value) => {
            state.cacahMeterAddr = value;
        },
        SET_USER(state, value) {
            state.oSearchData = value;
        },
        SET_CARDMAC(state, value) {
            state.bluetoothId = state.cardMac = value;
        },
        CLEAN_METERADDR(state) {
            state.cacahMeterAddr = '';
            state.bluetoothId = '';
            state.waterNo = '';
            state.flag = 0;
            state.type = 0;
            state.waterno = 0;
            state.oSearchData = {}
            state.cardInfo = {}
            state.cardMac = '000000000000'
        },
        UPDATE_PAY(state, value) {
            state.flag = value
        },
        UPDATE_CARDITEM(state, value) {
            state.type = value
        },
        SET_BLUETOOTHID(state, { bluetoothId, bluetoothIdCounts }) {
            state.bluetoothId = bluetoothId
            state.bluetoothIdCount = bluetoothIdCounts
        },
        SET_CARDINFO(state, value) {
            state.cardInfo = value
        },
        SET_WATERNO(state, value) {
            state.waterNo = value
        },
        UPDATE_WATERNO(state, value) {
            state.waterno = value
        }

    }

};

export default card;
